import request from "./request.js";
// 获取门店列表
export const queryShopPage = (data) => {
  return request({
    url: `/app-api/shop/queryShopPage`,
    method: "POST",
    data,
  });
};
// 获取广告轮播图
export const getBannerList = (data) => {
  return request({
    url: `/app-api/promotion/banner/list`,
    method: "GET",
    data,
  });
};
// 即时开台获取店铺信息
export const getConfirmView = (data) => {
  return request({
    url: `/app-api/trade/billiard-order/queryConfirmView`,
    method: "GET",
    data,
  });
};
// 创建订单
export const createBilliardOrder = (data) => {
  return request({
    url: `/app-api/trade/billiard-order/createBilliardOrder`,
    method: "POST",
    data,
  });
};
// 下单
export const orderSubmit = (data) => {
  return request({
    url: `/app-api/pay/order/submit`,
    method: "POST",
    data,
  });
};
// 订单列表
export const orderPage = (data) => {
  return request({
    url: `/app-api/trade/billiard-order/page`,
    method: "GET",
    data,
  });
};
// 获取结算金额
export const billiardSettlement = (data) => {
  return request({
    url: `/app-api/trade/billiard-order/billiardSettlement`,
    method: "POST",
    data,
  });
};
// 我的团购卷
export const listGroupBuy = (data) => {
  return request({
    url: `/app-api/promotion/groupbuy/listGroupBuy`,
    method: "POST",
    data,
  });
};
// 订单详情
export const orderDetail = (data) => {
  return request({
    url: `/app-api/trade/order/get-detail`,
    method: "GET",
    data,
  });
};
// 获取门店信息
export const queryShopDetails = (data) => {
  return request({
    url: `/app-api/shop/queryShopDetails`,
    method: "GET",
    data,
  });
};
// 卷码验证
export const prepareGroupBuy = (data) => {
  return request({
    url: `/app-api/promotion/groupbuy/prepareGroupBuy?code=${data}`,
    method: "POST",
  });
};
// 获取充值套餐列表
export const walletRechargePackageList = (data) => {
  return request({
    url: `/app-api/pay/wallet-recharge-package/list`,
    method: "GET",
  });
};
// 创建充值订单
export const walletRechargeCreate = (data) => {
  return request({
    url: `/app-api/pay/wallet-recharge/create`,
    method: "POST",
    data,
  });
};
// 我的钱包
export const getWallet = ({isLogin = true}) => {
  return request({
    url: `/app-api/pay/wallet/get`,
    method: "GET",
    isLogin:isLogin,
  });
};
export const walletTransactionPage = (data) => {
  return request({
    url: `/app-api/pay/wallet-transaction/page`,
    method: "GET",
    data,
  });
};
export const listItemByMainId = (data) => {
  return request({
    url: `/app-api/app/billiard/main/item/listMainAndItem`,
    method: "POST",
    data,
    isLogin:true,
  });
};
// 获取可领取活动劵
export const getListActivity = (data) => {
  return request({
    url: `/app-api/promotion/activity/listActivity`,
    method: "GET",
    data,
    isLogin:true,
  });
};
// 获取优惠券列表
export const getcoupon = (data) => {
  return request({
    url: `/app-api/promotion/coupon/page`,
    method: "GET",
    isLogin:true,
    data,
  });
};
export const uploadFile = (data) => {
  return request({
    url: `/app-api/infra/file/upload`,
    method: "POST",
    data,
  });
};
// 更新用户信息
export const updateUser = (data) => {
  return request({
    url: `/app-api/member/user/update`,
    method: "PUT",
    data,
  });
};
// 获取可用优惠卷数量
export const getUnusedCount = (data) => {
  return request({
    url: `/app-api/promotion/coupon/get-unused-count`,
    method: "GET",
    data,
  });
};
// 获取订单优惠卷信息
export const getBilliardMatchCouponList = (data) => {
  return request({
    url: `/app-api/trade/billiard-order/getBilliardMatchCouponList`,
    method: "POST",
    data,
  });
};
export const billiardRefund = (data) => {
  return request({
    url: `/app-api/trade/after-sale/billiard-create`,
    method: "POST",
    data,
  })
}
export const preOrderWithOnline = (data) => {
  return request({
    url: `/app-api/trade/billiard-order/preOrderWithOnline`,
    method: "GET",
    data,
  })
}
export const getRecentlypreOrder = (data) => {
  return request({
    url: `/app-api/trade/billiard-order/get-recently-pre-order`,
    method: "GET",
    data,
  })
}

export const getNotice = (data) => {
  return request({
    url: `/app-api/shop/notice/page`,
    method: "GET",
    data,
  })
}
export const getOpenDoorToken = (data) => {
  return request({
    url: `/app-api/shop/getOpenDoorToken`,
    method: "POST",
    data,
  })
}
export const openDoor = (data) => {
  return request({
    url: `/app-api/shop/openDoor`,
    method: "POST",
    data,
  })
}
